<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>回调函数之 5秒后自动关闭广告</title>
</head>
<body>
    <!-- 分析 
        5秒后 就把这个广告隐藏起来
        用定时器 setTimeout()
     -->
     <img src="/aierbude.jpg" alt="" class = "ad">
     <script>
        //  1 获取元素
         var ad = document.querySelector('.ad');
         setTimeout(function(){
             ad.style.display = 'none';
         },2000);

     </script>
</body>
</html>